CC:=gcc
CFLAGS:=-c -g -Wall
RM:=rm -rf
CLIENTAPP:=client
SERVERAPP:=server
DAEMONAPP:=daemon
DBAPP:=db
UTILSAPP:=utils
OBJS_DAEMON:=daemon.o
# OBJS_CLIENT:=client.o menu.o adminOpt.o userOpt.o ../server/loginAndRegister.o ../db/dbDefinition.o ../db/dbOperation.o ../utils/logUtil.o ../utils/parseStringUtil.o ../utils/timerRecordUtil.o ../server/adminSys.o ../server/userSys.o
# OBJS_SERVER:=server.o adminSys.o userSys.o loginAndRegister.o ../db/dbDefinition.o ../db/dbOperation.o ../utils/logUtil.o ../utils/parseStringUtil.o ../utils/timerRecordUtil.o ../client/menu.o ../client/adminOpt.o ../client/userOpt.o
OBJS_CLIENT:=client.o menu.o adminOpt.o userOpt.o
OBJS_SERVER:=server.o loginAndRegister.o
OBJS_DB:=dbDefinition.o dbOperation.o
OBJS_UTILS:=logUtil.o parseStringUtil.o timerRecordUtil.o
OBJS_SYS:=adminSys.o userSys.o

export CC CFLAGS RM CLIENTAPP SERVERAPP DAEMONAPP DBAPP UTILSAPP OBJS_DAEMON OBJS_CLIENT OBJS_SERVER OBJS_DB OBJS_UTILS OBJS_SYS

All:
	# 进入src/db/
	make -C ./src/db/
	# 进入src/utils/
	make -C ./src/utils/
	# 进入src/daemon/
	make -C ./src/daemon/
	# 进入src/sys/
	make -C ./src/sys/
	# 进入src/client/
	make -C ./src/client/
	# 进入src/server/
	make -C ./src/server/
	# 进入obj/client/
	make -C ./obj/client/
	# 进入obj/server/
	make -C ./obj/server/

.PHONY:clear
clear:
	$(RM) ./bin/client/client
	$(RM) ./bin/server/server
	$(RM) ./bin/server/daemon
	$(RM) ./obj/client/*.o
	$(RM) ./obj/server/*.o
